import request from '@/api/http.js'

// 获取工单列表数据详情 
export const WorkOrderSearchListDetail = (id) =>{
    return request.get('api/ProductionWorkOrder/getDetailPageData?id='+id)
}

// 获取工单列表数据
export const WorkOrderSearchList = (params) =>{
    console.log('工单列表发送参数:', params)
    const query = new URLSearchParams(params).toString();
    return request.get(`api/ProductionWorkOrder/getPageDate?${query}`)
}


//获取存货数据
export const getInventory = (params) => {
  return request.post('api/Inventory/getPageData', params)
}

//获取工序数据
export const getProcess = (params) => {
    return request.post('api/Process/getPageData', params)
}

// 获取工单编号
export const getProcessCode = () => {
    return request.get('api/ProductionWorkOrder/GetProductionWorkOrder')
}

// 新增工单
export const addProcess = (params) => {
    console.log('addProcess发送参数:', params)
    return request.post('api/ProductionWorkOrder/AddProductionWorkOrder',params)
}

// 更改工单状态
export const changeWorkStatus = (params) => {
    console.log('changeWorkStatus发送参数:', params)
    return request.post('api/ProductionWorkOrder/ChangeProductionWorkOrderStatus',params)
}

// 获取完工单列表
export const getCompletedWorkList = (params) =>{
    const query = new URLSearchParams(params).toString();
    return request.get(`api/ProductionCompletedWork/GetCompletedWorkList?${query}`)
}

// 获取仓库信息
export const getWarehouseList = (params) => {
    console.log('changeWorkStatus发送参数:', params)
    return request.post('api/Warehouse/getPageData',params)
}

// 完工单审核
export const checkProductionReportWorkOrder = (params) => {
    return request.post('api/ProductionCompletedWork/CheckProductionReportWorkOrder',params)
}
